<template>
  <div class="gengduoxx">
    <div class="head" v-if="type=='yd'">创作引导详情</div>

    <div class="head" v-if="type=='gg'">公告详情</div>

    <div class="head" v-if="type=='xx'">学习详情</div>

    <div class="head" v-if="type=='hd'">活动详情</div>

    <div   v-if="this.id>0" class="ttile1">{{details.title}}</div>
    <div v-if="this.id>0" class="ttile2">{{details.created_at}}</div>

    <div v-if="this.id==-1" class="ttile1">文章创作手册</div>
    <div v-if="this.id==-2" class="ttile1">视频创作手册</div>
    <div v-if="this.id==-3" class="ttile1">涨粉设置手册</div>
    <div v-if="this.id==-4" class="ttile1">收益获取手册</div>

    <div v-if="this.id<0" class="ttile2">阅读手册  玩转韩乐讯</div>

<!-- article_creation-文章创作手册 video_creation-视频创作手册 powder_setting-涨粉设置手册 earnings-收益获取手册 -->

    <div class="ttile3" v-if="type=='yd'">{{details.content}}</div>

    <div class="ttile3" id="aaaa" v-if="type=='gg'||type=='xx'||type=='hd'"></div>

    <div class="ttile3" id="bbbb" v-if="type=='sc'"></div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      list: "",
      type: "",
      id: "",
      details: ""
    };
  },
  methods: {
    getgonggaodetails() {
      if (this.type == "yd") {
        this.$get(
          // method: "get",
          "media/hairs/guide_show",
          {
            uqid: localStorage.getItem("uqid"),
            id: this.id
          }
        ).then(response => {
          console.log(response);
          if (response.error == "0") {
            // this.xiaoxilist = response.data;
            this.details = response.data;
          } else {
            this.$message({
              showClose: true,
              message: response.message,
              type: "error"
            });
          }
        });
      }
      if (this.type == "hd"||this.type == "gg"||this.type == "xx") {
        this.$get(
          // method: "get",
          "media/users/notice_show",
          {
            uqid: localStorage.getItem("uqid"),
            id: this.id
          }
        ).then(response => {
          console.log(response);
          if (response.error == "0") {
            // this.xiaoxilist = response.data;
            this.details = response.data;

            document.getElementById("aaaa").innerHTML = this.details.content;
          } else {
            this.$message({
              showClose: true,
              message: response.message,
              type: "error"
            });
          }
        });
      }
      if (this.type == "sc") {
        var key=''
        // article_creation-文章创作手册 video_creation-视频创作手册 powder_setting-涨粉设置手册 earnings-收益获取手册
        if(this.id==-1){
          key="article_creation"
        }
        if(this.id==-2){
          key="video_creation"
        }
        if(this.id==-3){
          key="powder_setting"
        }
        if(this.id==-4){
          key="earnings"
        }
        this.$get(
          // method: "get",
          "media/users/config_get_value",
          {
            key: key
            
          }
        ).then(response => {
          console.log(response);
          if (response.error == "0") {
            // this.xiaoxilist = response.data;
            this.details = response.data;

            document.getElementById("bbbb").innerHTML = this.details;
          } else {
            this.$message({
              showClose: true,
              message: response.message,
              type: "error"
            });
          }
        });
      }

      

      
    }
  },
  mounted() {
    if(!localStorage.getItem('uqid')){
      this.$router.push({ path: "/login", query: {  } });
      return
    }
    var type = this.$route.query.type;
    var id = this.$route.query.id;
    this.type = type;
    this.id = id;
    this.getgonggaodetails();
  }
};
</script>

<style  scoped>
.ttile1 {
  text-align: center;
  font-size: 24px;
  font-weight: 600;

  line-height: 22px;
  color: rgba(51, 51, 51, 1);
  opacity: 1;
}
.ttile2 {
  text-align: center;
  font-size: 13px;
  line-height: 17px;
  color: rgba(172, 172, 172, 1);
  opacity: 1;
  margin-top: 11px;
  margin-bottom: 15px;
}
.ttile3 {
  font-size: 14px;
  padding: 0 27px;
  box-sizing: border-box;

  line-height: 20px;
  color: rgba(51, 51, 51, 1);
  opacity: 1;
  text-indent: 28px;
}
.dingwei {
  position: absolute;
  top: 14px;
  right: 14px;
}
.juzhong {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.biaoti {
  font-size: 16px;
  line-height: 22px;
  color: rgba(51, 51, 51, 1);
}
.jianjie {
  margin-top: 14px;
  font-size: 14px;
  line-height: 20px;
  color: rgba(92, 92, 92, 1);
}
.leixing {
  margin-top: 14px;
  font-size: 12px;
  line-height: 17px;
  color: rgba(178, 178, 178, 1);
}
.nrr {
  margin-top: 26px;
  width: 100%;
  padding: 0 0 0 26px;
}
.item {
  position: relative;
  width: 30%;
  height: 153px;
  background: rgba(255, 255, 255, 1);
  box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.06);
  opacity: 1;
  border-radius: 6px;
  float: left;
  margin-right: 18px;
  padding: 21px 23px;
  box-sizing: border-box;
}

.title {
  width: 80%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.head {
  font-size: 18px;
  color: rgba(51, 51, 51, 1);
  padding: 0 26px;
}
.gengduoxx {
  height: calc(100% - 118px);
  background: rgba(255, 255, 255, 1);
  padding: 26px 0;
  box-sizing: border-box;
  overflow: hidden;
  overflow-y: scroll;
  position: relative;
}

.gengduoxx::-webkit-scrollbar {
  display: none;
}
</style>